package com.chiyou.common.utils;


public class TestRedis {
	public static void main(String[] args) {
		//对hset的测试
		/*String test = "test";
		//List测试
		String listKey = "list";
		List list = new ArrayList();
		list.add("abc");
		list.add("abc2");
		RedisUtilHset redisSet = new RedisUtilHset();
		redisSet.hset(test, listKey, list);
		//redisSet.expire(test, 1000);
		List temp = (List)redisSet.hmget(test, listKey,listKey,listKey,listKey);
		for(Object o : temp){
			System.out.println("temp="+o);
		}
		
		Map map= redisSet.hgetAll(test);
		for(Object o : map.keySet()){
			System.out.println(o + ":" + map.get(o));
		}
		System.out.println(redisSet.hexists(test, listKey));
		List l = redisSet.hkeys(test);
		for(Object o : l){
			System.out.println(o);
		}
		redisSet.hdel(test, listKey);
		System.out.println(redisSet.hexists(test, listKey));
		redisSet.del(test);
		System.out.println(redisSet.exists(test));*/
		
		//对str的测试
		RedisUtilStr redisStr = new RedisUtilStr();
		String setKey = "set";
		String setVal = "setVal";
		redisStr.set(setKey, setVal,0);
		System.out.println(redisStr.get(setKey));
	}
}
